package com.spider.method1reference;

import java.util.Arrays;

public class Demo3 {
    public static void main(String[] args) {
        //目标：特定类型的方法引用
        //需求：有一个字符串数组，里面有一些人的英文名字，把名字按照首字母排序，要英文名称。
        String[] names = {"Carn", "Bob", "Alice", "Om", "Jack","Lucy","Spider","apex","David"};
        Arrays.sort( names);
        System.out.println(Arrays.toString( names));
        //忽略大小写
        Arrays.sort( names, String::compareToIgnoreCase);
        System.out.println(Arrays.toString( names));

    }
}
